#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main()
{
	char ch[50000] = { 0 };
	scanf("%s", ch);
	int N = strlen(ch);
	int i = 0;
	for (i = 1; i < N; i++)
	{
		scanf("%s", ch + i * N);
	}
	printf("%d ", N);

	int count = 1;
	if (ch[0] == '1')
		printf("0 ");
	for (i = 0; i < N * N; i++)
	{
		if (ch[i] == ch[i + 1] && ch[i + 1] != '\0')
		{
			count++;
		}
		else
		{
			printf("%d ", count);
			count = 1;
		}
	}
	return 0;
}